#ifndef _BSP_HAL_TIM_H_
#define _BSP_HAL_TIM_H_

#include "tim.h"


#ifdef __TIM_H__
	void Tim_Init(void);
	int32_t TIM_Get_Encoder(TIM_HandleTypeDef* htimx,int32_t Pulse);
#endif


#if (defined TIM1_IT) || (defined TIM1_ENCODER) || (defined TIM1_PWM)
	__weak void TIM1_Handler(void);
	#if (defined TIM1_ENCODER)
		#define TIM1_Get_Encoder(Pulse) TIM_Get_Encoder(&htim1,Pulse)
	#endif
#endif

#if (defined TIM2_IT) || (defined TIM2_ENCODER) || (defined TIM2_PWM)
	__weak void TIM2_Handler(void);
	#if (defined TIM2_ENCODER)
		#define TIM2_Get_Encoder(Pulse) TIM_Get_Encoder(&htim2,Pulse)
	#endif
#endif

#if (defined TIM3_IT) || (defined TIM3_ENCODER) || (defined TIM3_PWM)
	__weak void TIM3_Handler(void);
	#if (defined TIM3_ENCODER)
		#define TIM3_Get_Encoder(Pulse) TIM_Get_Encoder(&htim3,Pulse)
	#endif
#endif

#if (defined TIM4_IT) || (defined TIM4_ENCODER) || (defined TIM4_PWM)
	__weak void TIM4_Handler(void);
	#if (defined TIM4_ENCODER)
		#define TIM4_Get_Encoder(Pulse) TIM_Get_Encoder(&htim4,Pulse)
	#endif
#endif

#if (defined TIM5_IT) || (defined TIM5_ENCODER) || (defined TIM5_PWM)
	__weak void TIM5_Handler(void);
	#if (defined TIM5_ENCODER)
		#define TIM5_Get_Encoder(Pulse) TIM_Get_Encoder(&htim5,Pulse)
	#endif
#endif

#if (defined TIM6_IT) || (defined TIM6_ENCODER) || (defined TIM6_PWM)
	__weak void TIM6_Handler(void);
	#if (defined TIM6_ENCODER)
		#define TIM6_Get_Encoder(Pulse) TIM_Get_Encoder(&htim6,Pulse)
	#endif
#endif

#if (defined TIM7_IT) || (defined TIM7_ENCODER) || (defined TIM7_PWM)
	__weak void TIM7_Handler(void);
	#if (defined TIM7_ENCODER)
		#define TIM7_Get_Encoder(Pulse) TIM_Get_Encoder(&htim7,Pulse)
	#endif
#endif

#if (defined TIM8_IT) || (defined TIM8_ENCODER) || (defined TIM8_PWM)
	__weak void TIM8_Handler(void);
	#if (defined TIM8_ENCODER)
		#define TIM8_Get_Encoder(Pulse) TIM_Get_Encoder(&htim8,Pulse)
	#endif
#endif

#if (defined TIM9_IT) || (defined TIM9_ENCODER) || (defined TIM9_PWM)
	__weak void TIM9_Handler(void);
	#if (defined TIM9_ENCODER)
		#define TIM9_Get_Encoder(Pulse) TIM_Get_Encoder(&htim9,Pulse)
	#endif
#endif

#if (defined TIM10_IT) || (defined TIM10_ENCODER) || (defined TIM10_PWM)
	__weak void TIM10_Handler(void);
	#if (defined TIM10_ENCODER)
		#define TIM10_Get_Encoder(Pulse) TIM_Get_Encoder(&htim10,Pulse)
	#endif
#endif

#if (defined TIM11_IT) || (defined TIM11_ENCODER) || (defined TIM11_PWM)
	__weak void TIM11_Handler(void);
	#if (defined TIM11_ENCODER)
		#define TIM11_Get_Encoder(Pulse) TIM_Get_Encoder(&htim11,Pulse)
	#endif
#endif

#if (defined TIM12_IT) || (defined TIM12_ENCODER) || (defined TIM12_PWM)
	__weak void TIM12_Handler(void);
	#if (defined TIM12_ENCODER)
		#define TIM12_Get_Encoder(Pulse) TIM_Get_Encoder(&htim12,Pulse)
	#endif
#endif

#if (defined TIM13_IT) || (defined TIM13_ENCODER) || (defined TIM13_PWM)
	__weak void TIM13_Handler(void);
	#if (defined TIM13_ENCODER)
		#define TIM13_Get_Encoder(Pulse) TIM_Get_Encoder(&htim13,Pulse)
	#endif
#endif

#if (defined TIM14_IT) || (defined TIM14_ENCODER) || (defined TIM14_PWM)
	__weak void TIM14_Handler(void);
	#if (defined TIM14_ENCODER)
		#define TIM14_Get_Encoder(Pulse) TIM_Get_Encoder(&htim14,Pulse)
	#endif
#endif









#endif //_BSP_HAL_TIM_H_
